<div class="right">
	<div id="bread-nav" class="fn-clear">
		<ul>
			<li><a href="admin/home">后台首页</a></li>
			<li><a>预约信息管理</a></li>
		</ul>
	</div>
	<div id="content" class="text-darkgrey">
		<h2>预约信息管理</h2>
		<div class="add">
			<?php if($listMode!=0):?><a href="<?="admin/message/reservationList/0"?>">全部</a><?php else:?>全部<?php endif;?>/
			<?php if($listMode!=1):?><a href="<?="admin/message/reservationList/1"?>">已处理</a><?php else:?>已处理<?php endif;?>/
			<?php if($listMode!=2):?><a href="<?="admin/message/reservationList/2"?>">未处理</a><?php else:?>未处理<?php endif;?>/
			<?php if($listMode!=3):?><a href="<?="admin/message/reservationList/3"?>">已删除</a><?php else:?>已删除<?php endif;?>/
		</div>
		<div>
			<form action="admin/message/reservationList/<?=$listMode?>" method="post">
     			<input id="search" type="text" name="search" />
     		 	<input type="submit" value="搜索" class="submit" />
    		</form>
		</div>
		<?php if ($num > 0) : ?>
		<div class="table-container">
		<table style="width:920px;">
			<tr>
			<td class="short text-red center">编号</td>
			<td class="middle text-red center">客户名</td>
			<td class="middle text-red center">手机</td>
			<td class="middle text-red center">卡号</td>
			<td class="middle text-red center">状态</td>
			<td class="middle text-red center">申请时间</td>
			<td class="middle text-red center">预约时间</td>
			<td class="middle text-red center">处理时间</td>
			<td class="middle text-red center">处理人</td>
			<td class="long text-red center">处理结果</td>
			<td class="short text-red center">处理</td>
			<td class="short text-red center">删除</td>
			</tr>
			<?php foreach ( $list as $row ) : ?>
				<tr>
				<td class="short center"><?=$row ['id']?></td>
				<td class="middle center"><?=$row ['name']?></td>
				<td class="middle center"><?=$row ['mobile']?></td>
				<td class="middle center"><?=$row ['cardId']?></td>
				<?php if($row ['state']=='F'):?>
				<td class="middle  center">待处理</td>
				<?php elseif ($row ['state']=='T'):?>
				<td class="middle  center">已处理</td>
				<?php elseif ($row ['state']=='D'):?>
				<td class="middle center">已删除</td>
				<?php endif;?>
				<td class="middle  center"><?=date ( 'Y-m-d H:i:s', strtotime ( $row ['creatTime'] ) )?></td>
				<td class="middle  center"><?=date ( 'Y-m-d H:i:s', strtotime ( $row ['reserveTime'] ) )?></td>
				<td class="middle  center"><?php if ($row ['updateTime']) echo date ( 'Y-m-d H:i:s', strtotime ( $row ['updateTime'] ) );?></td>
				<td class="middle center"><?=$row ['dealPerson']?></td>
				<td class="long"><?=$row ['deal']?></td>
				<td class="short center"><input type="button" onclick="deal(<?=$row ['id']?>)" value="处理" class="padding" <?php if($row['state']=='T'||$row['state']=='D'):?>disabled<?php endif;?>></td>
				<td class="short center"><input type="button" onclick="dele(<?=$row ['id']?>)" value="删除" class="padding" <?php if($row['state']=='D'):?>disabled<?php endif;?>/></td>
				</tr>
			<?php endforeach;?>
		</table>
		</div>
		<div id="page-nav" class="fn-clear"><?php echo $this->pagination->create_links ();?></div>
		<?php else : ?>
		<p>没有记录！</p>
		<?php endif;?>
	</div>
	<link rel="stylesheet" href="css/dialog.css" />	
	<script type="text/javascript" src="js/dialog.js"></script>
	<script type="text/javascript">
	$(function(){		
		$('#dialog').dialog({
			autoOpen: false,
			modal: true,
			width: 300,
			height: 200
		});
	});
	
	function deal(str) {
		$('#dialog form').attr("action",getRootPath()+'/admin/message/dealReservation/'+str);
		$('#dialog').dialog('open');
	}
	function dele(str) {
		if (confirm("确认删除记录"+str+"？")){
			window.location = getRootPath()+'/admin/message/deleReservation/'+str;
		}
	}
	</script>
	<div id="dialog" title="处理结果">
		<form method="post">
		<p><textarea name="deal"></textarea></p>
		<p><input type="submit" value="完成处理" /></p>
		</form>
	</div>
</div>